package game.view;

import game.*;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

/**
 * Action for number button.
 * @author Natchanon Hongladaromp
 *
 */
public class NumberListener implements ActionListener
{
	private Board board;
	private int index;

	/**
	 * Construct for this action listener.
	 * @param board board
	 * @param index index of number
	 */
	public NumberListener(Board board,int index)
	{
		this.board = board;
		this.index = index;
	}
	
	@Override
	public void actionPerformed(ActionEvent arg0)
	{
		board.addNumber(index);
		board.calculate();
	}
}
